{{/* 接口路由-源 */}}
{{- $PkgNameLowerCase := .PkgName | FirstCharLowerCase -}}
{{- $PkgNameUpper := .PkgName | FirstCharUpper -}}
{{- $TableNameUpper := .TableName | FirstCharUpper -}}
package {{$PkgNameLowerCase}}Router


import (
	"github.com/Sir-yuChen/funAnalyse/api"
	"github.com/Sir-yuChen/funAnalyse/middleware"
	"github.com/gin-gonic/gin"
)

type {{$TableNameUpper}}Router struct {}

func (co *{{$TableNameUpper}}Router) {{$TableNameUpper}}ApiRouter(Router *gin.RouterGroup) {
    //todo 请自定义 路由分组
	commonJwtRouter := Router.Group({{$PkgNameLowerCase}}).Use(middleware.JWTAuth()).Use(middleware.CasbinMiddleware())
	api := api.ApiGroupApp.{{$PkgNameUpper}}ApiGroup.{{$TableNameUpper}}Controller
	{
	    //todo 请自定义 接口路由
		commonJwtRouter.GET("get{{$TableNameUpper}}", middleware.CheckApiResourcesMiddleware(nil), api.Get{{$TableNameUpper}})
		commonJwtRouter.POST("insert{{$TableNameUpper}}", middleware.CheckApiResourcesMiddleware(nil), api.Insert{{$TableNameUpper}})
		commonJwtRouter.POST("update{{$TableNameUpper}}", middleware.CheckApiResourcesMiddleware(nil), api.Update{{$TableNameUpper}})
		commonJwtRouter.GET("del{{$TableNameUpper}}", middleware.CheckApiResourcesMiddleware(nil), api.Del{{$TableNameUpper}})
	}
}
